Rules to declare variable
C++ imposes fairly strict rules on how you can name your variables:
nvariable names must begin with a letter
nvariable names are "case-sensitive" (i.e., the variable "myNumber" is different from the variable "MYNUMBER" which is different from the variable "mYnUmBeR")
nvariable names can't have spaces
nvariable names can't have special characters (typographic symbols, such as &, %, $, £ etc.)
Variables type
nA variable type is a description of the kind of information a variable will store.
What can you name your variables? In general, variable names can be composed of letters, numbers, and underscores (_). However, C++ reserves certain keywords which have special meaning to the language, and you are not allowed to use any of these keywords as variables names. Some examples of C++ keywords are int, for, else, and class. You can, however, use keywords in the middle of a variable name, such as "foreign" or "classical". For a complete list of C++ keywords, please see references on C/C++.
Programming languages vary regarding how strict they require you to be when declaring a variable's type. Some languages, like Perl, do not require you to announce the type of a variable. Other languages require you to declare some variables as numbers and others as text-strings, for example. C++, a strongly-typed language, requires you to be even more specific than that. Instead of declaring a variable as a number, you must say whether it will store integers or decimals. In C++, the type of an integer is int and the type of a decimal is float (floating-point number).